package com.xwj.entity;

import com.xwj.dto.RepairInfoDto;
import org.joda.time.DateTime;

import java.io.Serializable;
import java.util.UUID;

/**
 * 报修单信息
 */
public class RaRepairInfo implements Serializable {
    private static final long serialVersionUID = -7422253316252375704L;

    private String id;

    private String userId;

    private String phone;

    private String address;

    private String title;

    private String reason;

    private int status;

    private String createTime;

    private String updateTime;

    private String del_flag;

    private String statusStr;

    public RaRepairInfo() {
    }

    public RaRepairInfo(RepairInfoDto repairInfoDto) {
        this.id = UUID.randomUUID().toString().replaceAll("-", "");
        this.userId = repairInfoDto.getUserId();
        this.phone = repairInfoDto.getPhone();
        this.address = repairInfoDto.getAddress();
        this.title = repairInfoDto.getTitle();
        this.reason = repairInfoDto.getReason();
        this.createTime = new DateTime().toString("yyyy-MM-dd HH:mm:ss");
        this.updateTime = createTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getDel_flag() {
        return del_flag;
    }

    public void setDel_flag(String del_flag) {
        this.del_flag = del_flag;
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "RaRepairInfo{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", title='" + title + '\'' +
                ", reason='" + reason + '\'' +
                ", status=" + status +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", del_flag='" + del_flag + '\'' +
                ", statusStr='" + statusStr + '\'' +
                '}';
    }
}
